package com.kingtone.rongji;

import android.content.Intent;
import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

/**
 * @Author 李文辉
 * @Date 2015-6-8 下午3:08:51
 */
public class SendFriendsActivity extends BaseActivity
{
	private WebView webview;

	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_send_friends);
		webview = (WebView) findViewById(R.id.webview);
		WebSettings webSettings = webview.getSettings();
		// 设置WebView属性，能够执行Javascript脚本
		webSettings.setJavaScriptEnabled(true);
		// 设置可以访问文件
		webSettings.setAllowFileAccess(true);
		// 设置支持缩放
		webSettings.setBuiltInZoomControls(true);
		// 加载需要显示的网页
		Intent intent = getIntent();
		String orderNum = "";
		if(intent.hasExtra("orderNum"))
		{
			orderNum = intent.getStringExtra("orderNum");
			webview.loadUrl("http://rong.pupuxing.net/Purchase/PaymentCompleted?orderNumber=" + orderNum + "&orderType=6");
		}else
		{
			webview.loadUrl("http://www.m.rongji365.com");
		}
		 
		
		// 设置Web视图
		webview.setWebViewClient(new webViewClient());
	}

	// Web视图
	private class webViewClient extends WebViewClient
	{
		public boolean shouldOverrideUrlLoading(WebView view, String url)
		{
			view.loadUrl(url);
			return true;
		}
	}
}
